import java.util.Objects;

//编写重载的方法area分别计算圆、矩形、三角形的面积
public class Area {

    private double length;
    private double width;

    private double countArea(double r){
        return Math.PI*r*r;
    }

    private double countArea(){
        return length * width;
    }

    private double countArea(double heigth,double base){
        return (heigth * base) / 2;
    }



    public Area() {
    }

    public Area(double length, double width) {
        this.length = length;
        this.width = width;
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Area area = (Area) o;
        return Double.compare(length, area.length) == 0 && Double.compare(width, area.width) == 0;
    }

    @Override
    public int hashCode() {
        return Objects.hash(length, width);
    }

    @Override
    public String toString() {
        return "Area{" +
                "length=" + length +
                ", width=" + width +
                '}';
    }

}
